package cn.cs.client;

import cn.cs.config.CsConfiguration;
import cn.cs.fallback.InvoiceFallBack;
import cn.cs.pojo.Invoice;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(name = "cs-order-provider", configuration = CsConfiguration.class, fallback = InvoiceFallBack.class)
public interface RestInvoiceClient {

    @RequestMapping(value = "/getInvoiceById", method = RequestMethod.POST)
    public Invoice getInvoiceById(@RequestParam("id") String id)throws Exception;

    @RequestMapping(value = "/getInvoiceListByUserId", method = RequestMethod.POST)
    public List<Invoice>	getInvoiceListByUserId(@RequestParam("userId") String userId, @RequestParam("userPid") String userPid)throws Exception;

    @RequestMapping(value = "/getInvoiceCountByMap", method = RequestMethod.POST)
    public Integer getInvoiceCountByMap(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/getInvoiceListByMap", method = RequestMethod.POST)
    public List<Invoice> getInvoiceListByMap(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/addInvoice", method = RequestMethod.POST)
    public Integer addInvoice(@RequestBody Invoice invoice)throws Exception;

    @RequestMapping(value = "/modifyInvoice", method = RequestMethod.POST)
    public Integer modifyInvoice(@RequestBody Invoice invoice)throws Exception;

    @RequestMapping(value = "/deleteInvoiceById", method = RequestMethod.POST)
    public Integer deleteInvoiceById(@RequestParam("id") Long id)throws Exception;

    @RequestMapping(value = "/updateAccountDetailByIds", method = RequestMethod.POST)
    public Integer updateAccountDetailByIds(@RequestBody String[] ids)throws Exception;



}
